package com.baibei.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

/**
 * {
 * "couponId": 352575829181464600,
 * "couponType": 17,
 * "couponName": "大彭彭券",
 * "faceValue": 1,
 * "effectiveTime": 1504146528000,
 * "expireTime": 1504232928000,
 * "status": "EXPIRED"
 * }
 * 体验券实体
 * GIVED-可用（已发放），USED-已使用，EXPIRED-已过期
 * Created by shenminjie on 2017/9/1.
 * mail:shenminjie@100bei.com
 */

public class CouponInfo implements Serializable, Parcelable {

    /**
     * 三大状态
     */
    public static final String STATUS_GIVED = "GIVED";
    public static final String STATUS_USED = "USED";
    public static final String STATUS_EXPIRED = "EXPIRED";

    private String couponId;

    private int couponType;

    private String couponName;

    private int faceValue;

    private long effectiveTime;

    private long expireTime;

    private String status;

    private ProductInfo product;



    public String getCouponId() {
        return couponId;
    }

    public void setCouponId(String couponId) {
        this.couponId = couponId;
    }

    public int getCouponType() {
        return couponType;
    }

    public void setCouponType(int couponType) {
        this.couponType = couponType;
    }

    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public int getFaceValue() {
        return faceValue;
    }

    public void setFaceValue(int faceValue) {
        this.faceValue = faceValue;
    }

    public long getEffectiveTime() {
        return effectiveTime;
    }

    public void setEffectiveTime(long effectiveTime) {
        this.effectiveTime = effectiveTime;
    }

    public long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public ProductInfo getProduct() {
        return product;
    }

    public void setProduct(ProductInfo product) {
        this.product = product;
    }

    @Override
    public String toString() {
        return "CouponInfo{" +
                "couponId='" + couponId + '\'' +
                ", couponType=" + couponType +
                ", couponName='" + couponName + '\'' +
                ", faceValue=" + faceValue +
                ", effectiveTime=" + effectiveTime +
                ", expireTime=" + expireTime +
                ", status='" + status + '\'' +
                ", product=" + product +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.couponId);
        dest.writeInt(this.couponType);
        dest.writeString(this.couponName);
        dest.writeInt(this.faceValue);
        dest.writeLong(this.effectiveTime);
        dest.writeLong(this.expireTime);
        dest.writeString(this.status);
    }

    public CouponInfo() {
    }

    protected CouponInfo(Parcel in) {
        this.couponId = in.readString();
        this.couponType = in.readInt();
        this.couponName = in.readString();
        this.faceValue = in.readInt();
        this.effectiveTime = in.readLong();
        this.expireTime = in.readLong();
        this.status = in.readString();
    }

    public static final Parcelable.Creator<CouponInfo> CREATOR = new Parcelable.Creator<CouponInfo>() {
        @Override
        public CouponInfo createFromParcel(Parcel source) {
            return new CouponInfo(source);
        }

        @Override
        public CouponInfo[] newArray(int size) {
            return new CouponInfo[size];
        }
    };
}
